<?php
/**
 * Created by PhpStorm.
 * User: 尧
 * Date: 11/18/2016
 * Time: 9:59 PM
 */
namespace common\models;
use yii\db\ActiveRecord;

class Order extends ActiveRecord{

    /**
     * 用于返回当前模型对应的表名的方法
     * @return string
     */
    public function table(){
        return '{{%table}}';
    }


    public function rules(){
        return [
            ['created_at', 'default', 'value'=>function(){
                return time();
            }, 'on'=>['create', 'new']],
            ['updated_at', 'default', 'value'=>function(){
                return time();
            }],
            [['fetchTime', 'fetchAddress', 'shipTime', 'shipAddress', 'paymentMethod', 'note', 'created_at', 'updated_at'], 'safe'],
        ];
    }
}
